﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace The_LarX
{
    public class Transition_ToLeft : IScreenPositionTransition
    {
        public Transition_ToLeft()
        {
            Reset();
        }

        public virtual void Reset()
        {
            this.Finished = false;
            NextScreenPosition = new Vector2(Engine.GraphicsDevice.PresentationParameters.BackBufferWidth, 0);
            LastScreenPosition = Vector2.Zero;
        }

        public int ScreenSpeed = 20;
        public virtual void Update()
        {
            if (NextScreenPosition.X > 0)
            {
                NextScreenPosition = AnimationHelper.AnimateStatic(NextScreenPosition, Vector2.Zero, 10);
                LastScreenPosition = AnimationHelper.AnimateStatic(LastScreenPosition,
                    new Vector2(-Engine.GraphicsDevice.PresentationParameters.BackBufferWidth * 2, 0), 10);
            }
            else
            {
                Finished = true;
            }
        }

        public virtual void Draw()
        {
        }

        public bool Finished { get; set; }

        public Vector2 LastScreenPosition { get; set; }

        public Vector2 NextScreenPosition { get; set; }
    }
}
